package CountDownLatchTest;

import java.util.concurrent.CountDownLatch;

/**
 * Created by dycong on 2017/4/5.
 */
public class Worker2 implements Runnable {
    private CountDownLatch doneSignal;
    public Worker2(CountDownLatch c){
        doneSignal=c;
    }
    @Override
    public void run(){
        System.out.println("doing...");
        try {
            Thread.sleep(1000);
        }catch (Exception e){

        }
        doneSignal.countDown();
    }
}
